#ifndef _SYS_FIELD_H_
#define _SYS_FIELD_H_

#include "Slot.h"
#include "SysTypes.h"

#define FIELD_VTABLE(self)   ((FieldVTable*)((FanObj*)self)->vtable)


extern Type*    Field_classType;
extern VTable*  Field_classVTable;


/* [sys::Field] Attributes */
struct Field
{
  Slot          super;
};


/* [sys::Field] Virtual-table */
typedef struct FieldVTable
{
  SlotVTable    super;
  NullableObj   (*get_0)(Field* self);
  NullableObj   (*get)(Field* self, NullableObj instance);
  void          (*set)(Field* self, NullableObj instance, NullableObj value);
} FieldVTable;


/* [sys::Field] Methods and fields */
Func*           Field_makeSetFunc(Map* vals);
Type*           Field_type(Field* self);
NullableObj     Field_get_0(Field* self);
NullableObj     Field_get(Field* self, NullableObj instance);
void            Field_set(Field* self, NullableObj instance, NullableObj value);


/* [sys::Field] Type-system functions */
Type*           Field_initType(void);
VTable*         Field_initVTable(void);
void            Field_initStatic(void);


#endif
